package com.wy.powerbuilder.service.impl.lwg;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wy.powerbuilder.entity.lwg.houses;
import com.wy.powerbuilder.entity.lwg.owner;
import com.wy.powerbuilder.mapper.lwg.housesMapper;

import com.wy.powerbuilder.service.lwg.housesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class housesServiceImpl implements housesService {
    @Autowired
    private housesMapper housesMapper;



    @Override
    public PageInfo<houses> selByPages(Integer pageNum, Integer pageSize,String h_unitNumber) {
        if(pageNum==null){
            pageNum = 1;//默认查询第一页
        }
        //对查询的信息进行分页
        //第一个参数当前页码,第二个每页的条数
        PageHelper.startPage(pageNum,pageSize) ; //使用分页插件开始分页
        //查询我们将要分页的信息
        List<houses> student = housesMapper.bll(h_unitNumber);
        //将查询的学生信息放到分页对象中去
        PageInfo<houses> pageInfo = new PageInfo<>(student);
        return pageInfo;
    }


    public PageInfo<houses> selBy(Integer pageNum, Integer pageSize,String h_state) {
        if(pageNum==null){
            pageNum = 1;//默认查询第一页
        }
        //对查询的信息进行分页
        //第一个参数当前页码,第二个每页的条数
        PageHelper.startPage(pageNum,pageSize) ; //使用分页插件开始分页
        //查询我们将要分页的信息
        List<houses> student = housesMapper.bbll(h_state);
        //将查询的学生信息放到分页对象中去
        PageInfo<houses> pageInfo = new PageInfo<>(student);
        return pageInfo;
    }
         public houses house(int h_id) {
        return housesMapper.house(h_id);
    }



    public Integer uphstate(houses house) {
        return housesMapper.uphstate(house);
    }

    @Override
    //将数据插叙到放到下下拉框
    public List<houses> linn() {
        List<houses> Houses=housesMapper.linn();
        return Houses;
    }


  public  houses zuih(int h_number){

        return housesMapper.zuih(h_number);
  }


}
